package com.share.user.api;

import com.share.common.core.constant.ServiceNameConstants;
import com.share.common.core.domain.Result;

import com.share.user.domain.UpdateUserLogin;
import com.share.user.domain.UserInfo;
import com.share.user.fallback.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * feign客户端 用户服务
 *
 * @author share
 */
@FeignClient(
        contextId = "remoteH5UserService",
        value = ServiceNameConstants.SHARE_USER,
        fallbackFactory = RemoteUserFallbackFactory.class) //降级类fallback
public interface RemoteH5UserService {

    //远程调用小程序端的登录接口
    @GetMapping("/userInfo/wxLogin/{code}")
    public Result<UserInfo> wxLogin(@PathVariable("code") String code);

    //远程调用更新用户登录信息
    @PutMapping("/userInfo/updateUserLogin")
    public Result<Boolean> updateUserLogin(@RequestBody UpdateUserLogin updateUserLogin);

    @GetMapping(value = "/userInfo/getUserInfo/{id}")
    public Result<UserInfo> getUserInfo(@PathVariable("id") Long id);

}
